package com.easygo.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.easygo.pojo.Goods;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

public interface GoodsService extends IService<Goods> {

    public Goods saveDocument(Goods goods);

    public Goods updateDocumentById(Goods goods);

    public void deleteDocument(Goods goods);

    public Page<Goods> selectDocumentByPage(Integer pageIndex, Integer pageSize);

    public Page<Goods> pageQuery(Integer pageIndex, Integer pageSize, String keywords);

    public List<Goods> getGoods();

    List<Goods> findGoodsByGoodsName(String goodsName);

    //根据标题查询(含分页)
    Page<Goods> findGoodsByGoodsName(String condition, Pageable pageable);

    /**
     * 多条件搜索
     * @param goodsName
     * @param caption
     * @param pageable
     * @return
     */
    Page<Goods> findGoodsByGoodsNameOrCaption(String goodsName, String caption, Pageable pageable);

}
